// 全局样式文件

// 重置样式
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  font-size: 14px;
  line-height: 1.6;
  color: #2c3e50;
  background-color: #f0f2f5;
}

#app {
  height: 100%;
}

// 滚动条样式
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
  
  &:hover {
    background: #a8a8a8;
  }
}

// 通用工具类
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-1 {
  flex: 1;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-20 {
  margin-top: 20px;
}

.p-16 {
  padding: 16px;
}

.p-20 {
  padding: 20px;
}

// 卡片样式增强
.el-card {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  
  .el-card__header {
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
    
    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      
      .card-title {
        font-size: 16px;
        font-weight: 600;
        color: #2c3e50;
      }
    }
  }
  
  .el-card__body {
    padding: 20px;
  }
}

// 表格样式增强
.el-table {
  .el-table__header {
    th {
      background-color: #fafafa;
      color: #606266;
      font-weight: 600;
    }
  }
  
  .el-table__row {
    &:hover {
      background-color: #f5f7fa;
    }
  }
}

// 表单样式增强
.el-form {
  .el-form-item__label {
    font-weight: 500;
    color: #606266;
  }
  
  .el-input__inner,
  .el-textarea__inner {
    border-radius: 6px;
  }
  
  .el-button {
    border-radius: 6px;
    font-weight: 500;
  }
}

// 分页样式增强
.el-pagination {
  .el-pager li {
    border-radius: 4px;
    margin: 0 2px;
  }
  
  .btn-prev,
  .btn-next {
    border-radius: 4px;
  }
}

// 消息提示样式增强
.el-message {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.el-notification {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

// 对话框样式增强
.el-dialog {
  border-radius: 12px;
  
  .el-dialog__header {
    padding: 20px 20px 10px;
    
    .el-dialog__title {
      font-size: 18px;
      font-weight: 600;
      color: #2c3e50;
    }
  }
  
  .el-dialog__body {
    padding: 10px 20px 20px;
  }
  
  .el-dialog__footer {
    padding: 10px 20px 20px;
  }
}

// 抽屉样式增强
.el-drawer {
  .el-drawer__header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    
    .el-drawer__title {
      font-size: 18px;
      font-weight: 600;
      color: #2c3e50;
    }
  }
  
  .el-drawer__body {
    padding: 20px;
  }
}

// 标签页样式增强
.el-tabs {
  .el-tabs__header {
    margin-bottom: 20px;
  }
  
  .el-tabs__nav-wrap {
    &::after {
      background-color: #f0f0f0;
    }
  }
  
  .el-tabs__item {
    font-weight: 500;
    
    &.is-active {
      color: #409eff;
      font-weight: 600;
    }
  }
}

// 菜单样式增强
.el-menu {
  border: none;
  
  .el-menu-item,
  .el-sub-menu__title {
    height: 48px;
    line-height: 48px;
    
    &:hover {
      background-color: rgba(64, 158, 255, 0.1);
    }
  }
  
  .el-menu-item.is-active {
    background-color: #409eff;
    color: #fff;
    
    &::before {
      display: none;
    }
  }
}

// 响应式布局
@media (max-width: 768px) {
  .el-card {
    margin: 10px;
    
    .el-card__header {
      padding: 12px 16px;
    }
    
    .el-card__body {
      padding: 16px;
    }
  }
  
  .el-table {
    font-size: 12px;
  }
  
  .el-pagination {
    text-align: center;
    
    .el-pagination__sizes,
    .el-pagination__jump {
      display: none;
    }
  }
  
  .el-dialog {
    width: 90% !important;
    margin: 5vh auto;
  }
}

@media (max-width: 480px) {
  .el-form {
    .el-form-item {
      .el-form-item__label {
        text-align: left;
        width: 100% !important;
        margin-bottom: 8px;
      }
      
      .el-form-item__content {
        margin-left: 0 !important;
      }
    }
  }
  
  .el-button-group {
    .el-button {
      padding: 8px 12px;
      font-size: 12px;
    }
  }
}

// 动画效果
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-enter-active,
.slide-leave-active {
  transition: transform 0.3s ease;
}

.slide-enter-from {
  transform: translateX(-100%);
}

.slide-leave-to {
  transform: translateX(100%);
}

// 加载状态
.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  
  .loading-text {
    margin-left: 12px;
    color: #909399;
  }
}

// 空状态
.empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #909399;
  
  .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
  }
  
  .empty-text {
    font-size: 14px;
  }
}
